/*    */ package com.zimbra.cs.filter.jsieve;
/*    */ 
/*    */ import java.util.List;
/*    */ import org.apache.jsieve.Argument;
/*    */ import org.apache.jsieve.Arguments;
/*    */ import org.apache.jsieve.Block;
/*    */ import org.apache.jsieve.SieveContext;
/*    */ import org.apache.jsieve.StringListArgument;
/*    */ import org.apache.jsieve.commands.AbstractActionCommand;
/*    */ import org.apache.jsieve.exception.SieveException;
/*    */ import org.apache.jsieve.exception.SyntaxException;
/*    */ import org.apache.jsieve.mail.MailAdapter;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class Tag
/*    */   extends AbstractActionCommand
/*    */ {
/*    */   protected Object executeBasic(MailAdapter mail, Arguments args, Block block, SieveContext context)
/*    */   {
/* 40 */     String tagName = (String)((StringListArgument)args.getArgumentList().get(0)).getList().get(0);
/*    */     
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/* 47 */     mail.addAction(new ActionTag(tagName));
/*    */     
/* 49 */     return null;
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */   protected void validateArguments(Arguments arguments, SieveContext context)
/*    */     throws SieveException
/*    */   {
/* 57 */     List<Argument> args = arguments.getArgumentList();
/* 58 */     if (args.size() != 1) {
/* 59 */       throw new SyntaxException("Exactly 1 argument permitted. Found " + args.size());
/*    */     }
/*    */     
/* 62 */     Object argument = args.get(0);
/* 63 */     if (!(argument instanceof StringListArgument)) {
/* 64 */       throw new SyntaxException("Expecting a string-list");
/*    */     }
/* 66 */     if (1 != ((StringListArgument)argument).getList().size()) {
/* 67 */       throw new SyntaxException("Expecting exactly one argument");
/*    */     }
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/filter/jsieve/Tag.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */